import ReactDOM from 'react-dom'
import './index.css'
const list = [
  { id: 1, name: '张三', money: 123 },
  { id: 2, name: '李四', money: 456 },
  { id: 3, name: '王五', money: 789 },
]

function render() {
  if (list.length === 0) {
    return <div>暂无数据</div>
  }
  return <div>
    <ul>
      {list.map((item, index) => {
        return (
          <li key={index}>
            <h3>id:{item.id}</h3>
            <p>姓名:{item.name}</p>
            <p>工资:{item.money}</p>
          </li>
        )
      })}
    </ul>
  </div>
}

// const element = <div>

// </div>

ReactDOM.render(render(), document.getElementById('root'))